package com.ravi.service.impl;

import com.ravi.common.constant.CheckExceptionEnum;
import com.ravi.common.exception.CheckException;
import com.ravi.mapper.DoctorMapper;
import com.ravi.model.dto.DoctorUserDto;
import com.ravi.service.intf.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DoctorServiceImpl implements DoctorService {

	@Autowired
	private DoctorMapper doctorMapper;

	@Override
	public DoctorUserDto doctorLogin(String username, String password){
		System.out.println(username);
		System.out.println(password);
		DoctorUserDto doctorUserDto = doctorMapper.docLogin(username, password);
		if (doctorUserDto == null) {
			throw new CheckException(CheckExceptionEnum.LOGIN_FAILED);
		}
		return doctorUserDto;
	}
}
